getHead()
goHomeIndex()


function goHomeIndex() {
    document.querySelector('#goHomeIndex').onclick = function () {
        window.location.href = "../HomeIndex.html"
    }

}


//获取头像
function getHead() {
    future.ajax({
        url: '/users/getHead',
        type: 'post',
        success: function (result) {
            let imgUrl = "./file/" + result.head;
            document.getElementById("hear_img").src = imgUrl;
            document.getElementById("user_name").innerText = result.username;
            document.getElementById("login_top_btn").innerText = "⇒";

        }, error: function () {
            document.getElementById("hear_img").src = " "
            // document.getElementById("hear_img").src=" "
            document.getElementById("user_name").innerText = "游客";
            document.getElementById("login_top_btn").innerText = "去登陆";
        }
    })
}